home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Daemon
/
MPGui.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-10-02
|
1KB
|
74 lines
#include "MP.h"
#include <dos/dos.h>
#include <dos/dostags.h>
#include <dos/dosextens.h>
//#define DEBUG
#include <debug.h>
extern UBYTE ModePro[];
extern struct MPSem *MPSem;
extern STRPTR PrefsPath;
/*
void __regargs _CXBRK(int l);
void __regargs _CXBRK(int l)
{
}
void __regargs __chkabort(void);
void __regargs __chkabort(void)
{
}
*/
BOOL ShowGUI(void)
{
LONG counter,pri;
pri=(LONG)FindTask(0)->tc_Node.ln_Pri+1;
pri=min(127,pri);
counter=0;
if(SendPrefsMsg(MP_PREFSTOFRONT,0,0) < 0)
{
if(SystemTags(PrefsPath,
SYS_Asynch, TRUE,
SYS_Input, 0,
SYS_Output, 0,
NP_Priority, pri,
NP_StackSize, 10240,
TAG_DONE))
{
//DKP("SystemTags=~0\n");
EZReq(0,0,ModePro,GetString(MSG_ERR_COULDNT_FIND_PREFS),GetString(MSG_REQ_OK),PrefsPath);
return(0);
}
else
{ // Sucess
//DKP("SystemTags=0 IoErr=%ld\n",IoErr());
while(MPSem->PrefsPort==0 && counter<50)
{
counter++;
Delay(10);
}
//DKP("Port=%8lx counter=%ld\n",MPSem->PrefsPort,counter);
if(MPSem->PrefsPort==0) // if no port return 0
return(0);
}
}
return(1);
}
void HideGUI(void)
{
SendPrefsMsg(MP_PREFSCLOSE,0,0);
}